//波次单
$(function(){
	$('#historypicklistDatagrid').datagrid({
		//url:getHistorypicklistUrl+"?randnum="+Math.floor(Math.random()*1000000),
		url:getHistorypicklistUrl,
		title:'历史波次单列表',
		fitColumns:true,
		rownumbers:true,
		pageSize:25,
		pageNumber:1,
		pageList:[1,2,5,10,15,20,25,30,40,50],
		columns:[[
		{field:'id',title:'操作',
				formatter:function(value,row,index){
					return '<a href="javascript:void(0)" onclick="historypicklistObj.viewBar('+value+')">查看</a>';
				},
		},
		{field:'picklist_no',title:'波次单编号',sortable:true},
		{field:'add_time',title:'生成时间'}
		]],
		onLoadError:function(data){
			var info=eval('('+data.responseText+')');
			$.messager.confirm('错误提示',info.message,function(r){
				var tab=$('#Tabs').tabs('getSelected');
				var index=$('#Tabs').tabs('getTabIndex',tab);
				$('#Tabs').tabs('close',index);
			});
		},
		rowStyler:function(index,row){
			if (row.color==0){
				return 'background-color:pink;color:blue;font-weight:bold;';
			}
		},
		pagination:true,
		fit:true,
	});
});
historypicklistObj={
	showAll:function(){
		$('#historypicklistDatagrid').datagrid({ queryParams:''});
	},
	viewBar:function(value){
		window.parent.showTab(picklistViewUrl,'波次单详情',value);
	}

}